<%@ page import="java.util.ArrayList" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%--引入JSTL核心标签库，我们才能使用JSTL标签--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
    ArrayList<String> persions  = new ArrayList<>();
    persions.add(0,"张三");
    persions.add(1,"李四");
    persions.add(2,"王五");
    persions.add(3,"赵六");
    persions.add(4,"田七");
    persions.add(5,"程八");
    request.setAttribute("list",persions);
%>
<%--
var:每一次遍历的对象
items:要遍历的对象
begin：哪里开始
end：到哪里
step：步长
--%>
<c:forEach var="person" items="${list}" begin="1" end="3" step="1">
    <c:out value="${person}"/><br>
</c:forEach>


</body>
</html>
